// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/

use db::user_operations;

mod db;
#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}


#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub async fn run() {

    //  let migrations = vec![
    //     // Define your migrations here
    //     Migration {
    //         version: 1,
    //         description: "create_initial_tables",
    //         sql: include_str!("../migrations/create_table.sql"),
    //         kind: MigrationKind::Up,
    //     }
    // ];

    tauri::Builder::default()
        .plugin(tauri_plugin_opener::init())
        .invoke_handler(tauri::generate_handler![user_operations::add_user,user_operations::get_user])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
